// 跳跃游戏

let arr = [2, 0, 1, 2, 3]
function more(arr) {

    let cover = 0
    for (let i = 0; i < arr.length; i++) {
        if (i <= cover) {
            cover = Math.max(arr[i] + i , cover)
            if (cover >= arr.length - 1) {
                return true
            }
        }
    }
    return false
}
console.log(more(arr))